#!/usr/bin/python

import os

DIR = "/media/Stuff/books/" # change this to your path

authors = {}

for name in os.listdir(DIR):
    if os.path.isdir(DIR + name):
        authors[name] = ""

for name in authors:
    titles = []
    for root, dirs, title in os.walk(DIR + name):
        for x in title:
            titles.append(x)            
    authors[name] = titles

print authors
